#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		int sum=0,sum1=0;
		cin>>s;
		for(int i=0;i<s.size();i++)
		{
			if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
			{
				sum++;
			}
			else
			{
				sum1++;
			}
		}
		cout<<s<<endl;
		if(sum>sum1)
		{
			cout<<1<<endl;
		}
		else
		{
			cout<<0<<endl;
		}
	}
 } 
